UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0GEVAS96YAL3m8wT98ZJVyEQqH26dnSbnbD5B16E130='
WHERE
key_id = '1e4d3b02f27d48e2c2004b58c1322ef8005aafab8ab1c1c97ee6730a268b44ef'
AND (
token = '0GEVAS96YAL3m8wT98ZJVyEQqH26dnSbnbD5B16E130='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)