UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ejv2jR6Ag1NCncAz3Epc+100JmWcF4/7C8IKD3UAJes='
WHERE
key_id = 'afe01f37cb343f9275f8a161944fed00306cdc4d27829bd678124b98c95ce48d'
AND (
token = 'Ejv2jR6Ag1NCncAz3Epc+100JmWcF4/7C8IKD3UAJes='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)