UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OVQRzMF2CBQBLtSxT+owVNgR3BYTy4PZjODYDYdXfQE='
WHERE
key_id = '021cfb03373b7ad61c3fa810441a460a6b9447bd97adf700e88deb73f66de0bf'
AND (
token = 'OVQRzMF2CBQBLtSxT+owVNgR3BYTy4PZjODYDYdXfQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)