UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w7U7oDT+5S8UHeYUtFfqk/PxzbMO/WFrYgl0Yza8HDI='
WHERE
key_id = '8b9ee49ebda2333d1f5fe73bd0be36ad2854105d2316ee86d0179dff95648679'
AND (
token = 'w7U7oDT+5S8UHeYUtFfqk/PxzbMO/WFrYgl0Yza8HDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)