UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c46EOMRUHWTQTCC/UfPfDVOveLnJXXOaua9QxA/qp6U='
WHERE
key_id = 'aea142bd07c778fab4049968587d261b9f98109be31dbc985ddb8f2d2dc754d8'
AND (
token = 'c46EOMRUHWTQTCC/UfPfDVOveLnJXXOaua9QxA/qp6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)