UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q/+5mEaxSLjDVfZ5EE9JItMNa3roKy3P+vahwIoHdPI='
WHERE
key_id = '4c15b19892a1f1e8bb5b5bfe048b1c2e76bd86ba7fc77c5013f3fb4d834cbc9f'
AND (
token = 'q/+5mEaxSLjDVfZ5EE9JItMNa3roKy3P+vahwIoHdPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)