UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3qlqwRSV+kl9GQILpw2w3T+7PG6ckgVcslWyugiHi18='
WHERE
key_id = 'eb009c47cae66ed80620aa780501b2260e3e19ae8e74e7e4199ea76f48cf4d22'
AND (
token = '3qlqwRSV+kl9GQILpw2w3T+7PG6ckgVcslWyugiHi18='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)