UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eOvRVzf2Ttx36WTc33uOLMgitw7Kb0yJgBiDAQ8ldjQ='
WHERE
key_id = 'b863ee622deb4bd0e64167897a76d13c2a01376d19900b5c45fc13e86ad8108e'
AND (
token = 'eOvRVzf2Ttx36WTc33uOLMgitw7Kb0yJgBiDAQ8ldjQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)