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

Query time 0.00034