UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kYrbzshrBAv54AjDUa2RjuNjcimgkm65R6QUKo9WCE0=' 
WHERE 
  key_id = '6366c8a7f8bd7941577cf2cafa472265d6a02f9c6e08b9a4bbc39c33594f6d29' 
  AND (
    token = 'kYrbzshrBAv54AjDUa2RjuNjcimgkm65R6QUKo9WCE0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046