UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cGhQySYtNQdIkVtkDkTqiT+ZopjP9k7BXuQC6lSFBI8='
WHERE
key_id = '755625e6daa31f87f637543d62cc01aec7e233e4dd12e9ebcad21b3d5157ac3a'
AND (
token = 'cGhQySYtNQdIkVtkDkTqiT+ZopjP9k7BXuQC6lSFBI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)