UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Vt/oPRkUMEO/DIXvFQ032yBl5jv5kjjbgt16bFkKrw='
WHERE
key_id = 'ed5bb5b04d66f278da758fcbad1802f03d8c7ae5ba52c9ce99941dc22495d7d5'
AND (
token = '8Vt/oPRkUMEO/DIXvFQ032yBl5jv5kjjbgt16bFkKrw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)