UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OJ85W1SJwiyYW3A8OBSDfhGXzxnJTueJs2tv0XvR9R4='
WHERE
key_id = '2167771d0b975f7138056768ba44520875e4e404be47b8b5a78ed17e31060356'
AND (
token = 'OJ85W1SJwiyYW3A8OBSDfhGXzxnJTueJs2tv0XvR9R4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)