UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QSbBOGeTRk2m7WU4dKV43A6j6V79TIWhube5EtLsKh4=' 
WHERE 
  key_id = '70b6003b838ac1ba9463366a8b1507547190fcd0d1a57d03f016ec69a2c21a75' 
  AND (
    token = 'QSbBOGeTRk2m7WU4dKV43A6j6V79TIWhube5EtLsKh4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047