UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aGGzkJAo2ic/hOU3Vz4R+9/w0KlG9h9VeQy+F1pmkIs='
WHERE
key_id = '71c120a06d7dcb1eff7e705c9aff30c6be086aa99c60eb4d24b7d918ad43a306'
AND (
token = 'aGGzkJAo2ic/hOU3Vz4R+9/w0KlG9h9VeQy+F1pmkIs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)