UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PlV+BbObfHqNs0ErACHlfjTqM9oQik4m2onYTFdOPOc='
WHERE
key_id = '3236cebef9dcd368adb09fcd187d3010217c40984d34da7d658a2b4441962950'
AND (
token = 'PlV+BbObfHqNs0ErACHlfjTqM9oQik4m2onYTFdOPOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)