UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iPykRqjaWAMCDcTm/hv2dNxmB5de3gTodJ4CEzGZZLo='
WHERE
key_id = '3d3ea2cd187929d5e4dda3cbccdad76b0f42ea975c95591860fbe141a16cf0db'
AND (
token = 'iPykRqjaWAMCDcTm/hv2dNxmB5de3gTodJ4CEzGZZLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)