UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sGjnlZlQU8saFLQqxVmResPOVqlAVD6CGMfaHWY6UBA='
WHERE
key_id = '5621ab30db8e354f7e7b5ecbf078aaa7c554b3ee3b58aa3444dd374278a3bc56'
AND (
token = 'sGjnlZlQU8saFLQqxVmResPOVqlAVD6CGMfaHWY6UBA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)