UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oAEUuVTN3aT2noB0+TNg7i6OhRSTn7zSyCH1Aa2MLWA='
WHERE
key_id = 'fec6bc566f10a2366a5a9f2e47b4c1f779bb2138bab4e98fada5b9018fea8ac1'
AND (
token = 'oAEUuVTN3aT2noB0+TNg7i6OhRSTn7zSyCH1Aa2MLWA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)