UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cChBJvf0ehma5BfOzSom5Dmdofsc1i9DkpZUZ0yQ/oQ='
WHERE
key_id = 'f3105efdc74fb0d8be78e9d31b09614126dbfcba497d416a1ec5f0e8d8f28985'
AND (
token = 'cChBJvf0ehma5BfOzSom5Dmdofsc1i9DkpZUZ0yQ/oQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)