UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BcuIu83RmXIQttS/7yronboEm0BoESIYUQIQFsZKiGM='
WHERE
key_id = '64e648db47135324274f4d733e5ae99eb7f1faf16231b70766e20cfe6ded4f31'
AND (
token = 'BcuIu83RmXIQttS/7yronboEm0BoESIYUQIQFsZKiGM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)