UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'arjoqACXWUdzeVQZ28J2qNx14Bcs+eGRVNDqTEhijVk='
WHERE
key_id = 'e211bae3e8bb7db2c186d5531754ff050a5bd652c328d73f0598de07e20665a2'
AND (
token = 'arjoqACXWUdzeVQZ28J2qNx14Bcs+eGRVNDqTEhijVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)