UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HWlc0JyuvERBSUkPEbeax8vuFzzAuV1r6jmlDGb6/Do='
WHERE
key_id = '6526ffe7174bf199e3fd7ef0b6d4d6fe35fe0754694cac810ef3aebd35757aa7'
AND (
token = 'HWlc0JyuvERBSUkPEbeax8vuFzzAuV1r6jmlDGb6/Do='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)