UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7064UhCnouYBHjwulYBkivQiK6YfppF8KG5sCtwUtq4='
WHERE
key_id = 'a700963507fac67e7363678ef4d776de7d304e9d371d571b9487de3b8eac465b'
AND (
token = '7064UhCnouYBHjwulYBkivQiK6YfppF8KG5sCtwUtq4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)