UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+9ElvGaXQERkUQszbcHgbxOICVaBnBepVbqhBLmoV0s='
WHERE
key_id = '0aa38b86257e78d922d9bae908f4dfed6b9c70d44dc815c57efdb5ba9a89c9ff'
AND (
token = '+9ElvGaXQERkUQszbcHgbxOICVaBnBepVbqhBLmoV0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)