UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JykSaYsmeaOtGSgsIlWxX7ZD7JcyTkn/K4j/AtoSZLc=' 
WHERE 
  key_id = 'c528dea75ed48e6db485a08e42a6f02b7100db4b28642d472dec78448cc2b3c7' 
  AND (
    token = 'JykSaYsmeaOtGSgsIlWxX7ZD7JcyTkn/K4j/AtoSZLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00155