UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ocRpxBdsIcKopPyeHJ4swEXbTmyq+15pM/fY9AbMblM=' 
WHERE 
  key_id = '37ed64fa19a4afe442bde90ee3819da0922aae8a49aff263608589535ec14ad2' 
  AND (
    token = 'ocRpxBdsIcKopPyeHJ4swEXbTmyq+15pM/fY9AbMblM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019