UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GfTMD1Ut8uC0gL0ReL5PVLn2+A3/BtnibnJW44RiD5Q='
WHERE
key_id = '13f89e4e7d941b25b890d04a8555da957ee05af4b61015a1e392be27693e9643'
AND (
token = 'GfTMD1Ut8uC0gL0ReL5PVLn2+A3/BtnibnJW44RiD5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)