UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MJKO8s5QWYVeYmsFd4NUZlcqHCAA/bZ+sU39UbYwKxU='
WHERE
key_id = '11a7ae273bad773f327399296c1980c1546da7d46adc7175219ba547409c5d60'
AND (
token = 'MJKO8s5QWYVeYmsFd4NUZlcqHCAA/bZ+sU39UbYwKxU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)