UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eqX+xRAOCosheswyxC/hZtjgKlPaOax1kVOatgRXYdI='
WHERE
key_id = '5b84599bdf4cc64565ca043cf5500d972cd61c9a479396d0f6bc0f625c97ab7b'
AND (
token = 'eqX+xRAOCosheswyxC/hZtjgKlPaOax1kVOatgRXYdI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)