UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qpruv0cJlskrB5FGqPziF65GJVHSpMoqXOfh2ZVzedA='
WHERE
key_id = '2aad0265517ee1806ab347e5ade11354f4fa66879042ed8c93ad37f2921c3a4b'
AND (
token = 'Qpruv0cJlskrB5FGqPziF65GJVHSpMoqXOfh2ZVzedA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)