UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/jpTzy3owrX0AGGHISNZ2ynlCLqDLguA3tCZMEkyfpQ='
WHERE
key_id = 'd54537cae95b2f3b460e00843cb989d81d09180cabfe240423067d076b2928ac'
AND (
token = '/jpTzy3owrX0AGGHISNZ2ynlCLqDLguA3tCZMEkyfpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)