UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sXdDRUUcPtq503787hejJjrIy5sCFA/N1PpnFzDPnVI='
WHERE
key_id = '20778a863c8928e55bfb18582ffecf9af88378de998c1f51aa463a901d6cb16c'
AND (
token = 'sXdDRUUcPtq503787hejJjrIy5sCFA/N1PpnFzDPnVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)